import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;

public class prova {
	public static void main(String argv[]) throws Exception {
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try {
			conn = DriverManager.getConnection("jdbc:mysql://localhost/prova?" +
            "user=root&password=");
			stmt = conn.createStatement();
			stmt.execute("insert into test_table values('prova','prova1')");
			stmt.execute("insert into test_table values('prova2','prova3')");
			rs = stmt.executeQuery("select * from test_table");
			while (rs.next()) {
				System.out.println(rs.getString("A"));
			}
			rs.close();
			stmt.execute("truncate table test_table");
			stmt.close();
			conn.close();
		}
		catch(SQLException ex) {
			System.out.println("SQLException: " + ex.getMessage());
		    System.out.println("SQLState: " + ex.getSQLState());
		    System.out.println("VendorError: " + ex.getErrorCode());
		}
		System.out.println("Tu puzzi");
		Customer prova = new Customer("Giuseppe",
				"Spallone",
				"24/03/1984",
				new Address("Apricena","71011","Via Giordano Bruno",2),
				"giuseppe.spallone84@gmail.com",
				"3208861361",
				"splgpp84c24h926j");
		System.out.println(prova);
	}
}
